package com.copm.ifm.servers.sys.mapper;

import com.copm.ifm.servers.sys.entity.SysEquipmentType;
import com.copm.ifm.servers.sys.entity.SysLocationType;
import com.copm.ifm.servers.sys.entity.SysServerType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.copm.ifm.servers.sys.vo.SysEquipmentTypeVO;
import com.copm.ifm.servers.sys.vo.SysServerTypeVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 服务类型分类表 Mapper 接口
 * </p>
 *
 * @author tp
 * @since 2020-12-31
 */
public interface SysServerTypeMapper extends BaseMapper<SysServerType> {

    List<SysServerType> getEquTypeTree(@Param("tenantId") int tenantId, @Param("projId")int projId, @Param("enabled")int enabled);

    SysServerTypeVO selectParentEquById(@Param("parentEquId")Integer parentEquId);

    Integer selectMaxSeq(@Param("tenantId") int tenantId, @Param("projId")int projId, @Param("level")int level);

    SysServerType checkEquCode(@Param("tenantId") int tenantId, @Param("projId")int projId, @Param("code")String code);

    SysServerType checkEquName(@Param("tenantId") int tenantId, @Param("projId")int projId, @Param("name")String name);

    String selectMaxPath(@Param("tenantId") int tenantId, @Param("projId")int projId, @Param("parentPath")String parentPath);

    int updateLeafNode(SysServerType temp);

    SysServerType selectServerTypeByParentpath(Integer tenantId, Integer projectId, String parentPath);

    List<SysServerType> selectServerTypebyName(@Param("tenantId")Integer tenantId,@Param("projectId")Integer projectId,@Param("name")String name,@Param("parentPath")String parentPath);

    List<SysServerType> selectServerTypebyLevel(@Param("tenantId")Integer tenantId,@Param("projectId")Integer projectId,@Param("name")String name,@Param("level")Integer level);

    SysServerType selectHaveChild(Integer tenantId, Integer projectId, String path);

    SysServerType selectServerTypeNotEnable(Integer tenantId, Integer projectId, String path);

}
